package com.sys.gradepaysys.controller.event;

import com.alibaba.fastjson.JSON;
import com.sys.gradepaysys.dao.BaseDao;
import com.sys.gradepaysys.entity.ResultData;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;
import java.util.Map;

@WebServlet(name = "getOutEventList", value = "/getOutEventList")
public class getOutEventList extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String sql = "select * from payout";
        List<Map<String, String>> maps = BaseDao.selectList(sql);
        String s = "";
        s = JSON.toJSONString(new ResultData<>(200, null, maps));
        response.setContentType("text/json;charset=utf-8");
        response.getWriter().write(s);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
 doGet(request, response);
    }
}
